import request from '@/utils/request'

// 查询线索字段列表
export function getCluesList(type) {
    return request({
      url: '/field/bizCrmField/list/'+type,
      method: 'post',
    })
}
//查询场景列表
export function queryScene(type) {
    return request({
      url: '/field/bizCrmScene/queryScene?type='+type,
      method: 'post',
    })
  }
// 查询线索表头
export function getCluesListHead(type) {
    return request({
      url: '/field/bizCrmField/queryListHead/'+type,
      method: 'post',
    })
}
// 查询线索列表
export function queryPageList(data) {
    return request({
        url: '/crm/bizCrmLeads/queryPageList',
        method: 'post',
        data: data
    })
}
// 新增线索数据
export function addClue(data) {
    return request({
      url: '/crm/bizCrmLeads/add',
      method: 'post',
      data: data
    })
  }

// 根据ID查询信息
export function queryById(data) {
    return request({
      url: '/crm/bizCrmLeads/queryById',
      method: 'post',
      data: data
    })
}

//根据ID查询
export function queryByIdClues(clueId) {
  return request({
    url: '/crm/bizCrmLeads/queryById/'+clueId,
    method: 'post',
  })
}

// 删除线索
export function deleteByIds(data) {
    return request({
      url: '/crm/bizCrmLeads/deleteByIds',
      method: 'post',
      data:data,
    })
}
// 详细资料
// 查询详细资料
export function informationClues(clueId,data) {
  return request({
    url: '/crm/bizCrmLeads/information/'+clueId,
    method: 'post',
  })
}
// 编辑详细资料内容
export function updateInformationClues(data) {
  return request({
    url: '/crm/bizCrmLeads/updateInformation',
    method: 'post',
    data:data,
  })
}

// 编辑
//查询新增所需字段
export function queryCluesField(id) {
  return request({
    url: '/crm/bizCrmLeads/field/'+id,
    method: 'post',
  })
}

// 修改  编辑更新
export function updateClue(data) {
  return request({
    url: '/crm/bizCrmLeads/update',
    method: 'post',
    data:data,
  })
}

// 关注线索
export function starClue(clueId) {
  return request({
    url: '/crm/bizCrmLeads/star/'+clueId,
    method: 'post',
  })
}
// 转化为客户
export function transferCustom(data) {
  return request({
    url: '/crm/bizCrmLeads/transfer',
    method: 'post',
    data:data,
  })
}
